package com.alipay.config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2021000119699175";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCryjOj5vErSYmr1kBfcXwGSZgsc9xBhkvDks+Lbf6s1XDU61wn7XZ/fQOwZGhEfArO2vpR46/Lda/MR4JsL5oyFfttf2Jpr1rlsHWNnWLy2pyaNX5GcwNYjIFUPgpkRVlp6vF6LA8iXV0yha92dRqOChiwt0VW8tO2pvJP6Ac++9dr3w7KOMQJpqlZQY429F7ZHnjiphbOxdp9tciMW1lFJ/8dCH4DUISymK6MS6M8yo+K+UieCzUmBhj41bK8iITyNkSpqS6N5JeeFVMl0ifbOiyZlaq0kXm81U4cxjv43NX5QSzjauOgzKuwfB1Yh5GCMlXd7MTkMr9KAQqkFLD7AgMBAAECggEAL31NO0ELaGEC2ur2jqvrkj1kAN3ihIagiScbkrrMjXDPqTyLFEqT2HhxvaB0JoJ35mkoi9y6ay9Ucs9N4aRjJvdmswVk6jxcj2Rxir14bhQ6+HJTPxxqT19AHU6tRrzZE+ur548oe+J9cgr8z21d8ugdnTR8yaWFG1gZYjeNUT6OjknAHua3V8Dxa9MxM8oERBn2heseJC7jlnXkARo0dQ7KpJkrxOhbvRHegHUXVIKrJ4YVqQD75nOmltq0foSvnofxOmT+c1oTKWgsQbKkyft5cgWWSnAXMPVFNVKX4ieDY2RwgmrApm0XDUGDzV+XMU0MnIjIIh5p9irV7Ge7aQKBgQDudY5Ddk8n+bQON+IUOXZPc3qA/TnkZ8FtHTA4j66N/zBarMfk4tCJGs5uzuUUp6c/Zahq77BuxSlncU9qoCRyq8C5sdZ05lghBh5sYtvG9CE/yNt75ULu4s8jzoXl8l2BXD3sMvycIfYx1ocyZRc6foYlpIwQ+cc1+XoU5k+1ZwKBgQC4bTCrjbGmXu60Gh2LNyQpc6eTr2vimptbZfSFjxOrXPtymFtiV6Yjya0BUkUVyaHek8UHdp2Dl5EuH7f5KU2zeLLmfFlKfGa2uX25XM0cZ2lc/Uem2NNGNKK6OrKa/9J+hn3HT7DGn7kMvvIQB9Zo5AugTEryW/bKQ4B5CY43TQKBgHWm/KUeZ1my4vqs6dfOrifvMv8XcYvXAWFjqFoP0jDvOp1SaGHu4rLyze1wGSjCu0sVTi5MyoEsuAv4pRVXpAQL58/3BXex+sN4cGRLtmIIK6t734bWi9qvf0IMcJYOqcHckBTM50PlocHfNd9Qb1CGAovqDs2FX5uq1mgfZi57AoGAdOZZVFSTR5ajDawEEAtas5+ol/c4lkFTumJs1P+1AwkEJUYnnrVaDRM3wz+npMDTBqd521o3S4MWNjtKvPeOVfVqyKgHXSxvWuFGrOkC5j8yTQwKj9qeSMDyaMLuFUuU3DhZn62Gqs/xVv/tpXWiVYg/SlMxql/alail1ZLV/30CgYEAymEWRS+8TAPhHLENlwOFAd5fQgu2H5xiLH8Jg0sqopX/17RmPp/LYNp1CPdLLJ/1rPaWbu+qG4l/gT8Rvl2MpuB+XCcNzgYZD8UCg3ET/0ioa5wN94Q/4owI1J8mobNU9nt9hXVv5oszYT2+tJQI4/sK9SEWVpb47C87S4yWDaw=";
    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvX6UqdziUbsGqBQS001CrwUj27VAvH6uRcLP5tBUaR93OHRvU6ILZXBp5y+mt44DAuJETNOnEZycf7zqFf2MNf8Y1mpL7007E7OMVyiUj9fgk/J1QpxOaewLmCVFIfn1v9gkpONP6YhKhG6o6K7iv6rDXauvYkfhnbwXhgSGcnGUycCs7o/zKK6VniLFb9HqaVapx/Njpv6dSmoz1/flK9TP9DueOaHxH1EipX6/P0l/AnIVQjBUBWH3lQ8KSLZ7dSXXrHC6LhRmAHTQMF1h1hAGTpS9/OM4S7BNrDunWYHZIuO+dn6GBAW4WrJBhti35OXveh5bN1JNt/trMm2DgwIDAQAB";
    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://i3t5dq.natappfree.cc/dietOrder/notify";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://localhost:8080/#/order";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

